import { createApp } from "vue";
import App from "@/App";

import "normalize.css";
// 注册封装的常用的几个组件
import ImportElementPlus from '@/components/ElementPlus'
// 覆盖element-plus样式
import '@/components/ElementPlus/theme-chalk/scss/index.scss'
// 引入阿里字体图标
import "@/assets/fontIcon/iconfont.css";
import router from "@/router";
import store from "@/store";
// 微前端
import start from "@/micros";
// 启动
start();
import I18n from "@/lang/i18n";
// 注册所有图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import ComponentRegister from '@/utils/module'

/* import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

import Avue from '@smallwei/avue'
import '@smallwei/avue/lib/index.css'
import axios from 'axios' */

const app = createApp(App)
app.config.warnHandler = (msg, instance, trace) => {}

// 自动注册组件
app.use(ComponentRegister)

// 全局全部引入图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component); // 经过app.component注册后.tsx和.vue模版语法中都可以使用 但图标如果不单独在.tsx中引入 打包时不能编译通过 ts还是会提示你单独引入
}
app
  .use(store)
  .use(router)
  .use(ImportElementPlus)
  /* .use(ElementPlus)
  .use(Avue, { axios }) */
  .use(I18n)
  .mount('#app')
